<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎来到vinux世界</title>
<link href="/css/common/sqlbase.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="${jsPath}/js/front/js/jquery-1.8.3.js" type="text/javascript"></script>

<script type="text/javascript" >
function changeName(){
	var value = $("#selecttole ").val(); // 选中值
	var name = $("#selecttole").find("option:selected").text();//选中的文本
	if(value!=''){
	   $("#selectsq").val("select *from "+name+" ");
	} else {
		$("#selectsq").val("");
	}
  }
</script>
</head>
<style> 

td{border:1px solid black;}
</style>
<body>
<div class="wrapper">
      <select size="1" id="selecttole" name="selecttole" onChange="changeName()">
		<option value="">所有表</option>
		<#if nameList?exists>
		  <#list nameList as name>
		    <option value =${name}>${name}</option>
		   </#list>
		</#if>
	 </select>
      <form id="frm" name="frm" action="/initParameter/datelist.vhtml" method="post">
	   <TEXTAREA ROWS="3" COLS="50"  id="selectsq" name="selectsq" >${sqtext?if_exists}</TEXTAREA>
	   <input type="submit" value="查询" style="width:50px;float:inherit;margin-bottom:5px;padding:2px;" />
	   <input type="submit" value="复杂查询"  name ="search" style="width:70px;float:inherit;margin-bottom:5px;padding:2px;"/>
	</form>
		<!--   list  -->
		<div style="height:350px;overflow:auto;">
			<#if error??>
				${error}
			<#else>
				<table  >
				  <#if colnlist?exists>
					  <tr>
					   <#list colnlist as coln>
				          <td> ${coln} </td>
				       </#list>
				      </tr>
				        <#list page.list as data>
				           <tr>
				           <#list data as x>
				             <td>
				           <#if x??>
				             ${x}
				             </#if>
				             </td>
				            </#list>
				           </tr>
				        </#list>
			        
		         	</#if>
	     		</table>
     		</div>
     		
     		   <div class="fenye p20top p20bottom">
	     		    <form name="formId" id="formId" action="/initParameter/datelist.vhtml">
	     		    	<#escape x as x?html>
	     		    		<input type="hidden" value="${sqtext?if_exists}" name="selectsq"/>
	     		    	</#escape>
					       ${page.pageHtml}
					</form>
				</div>
	
		</#if>
	     
</div>
	
</body>
</html>